<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/xhtml/templates/layout.xhtml">

	<ui:define name="title"> 
      #{msgs.loginTitle}
   </ui:define>

	<ui:define name="content">

		<div class="central">
			<h:form prependId="false">
				<h:panelGrid cellspacing="10" id="loginGrid" columns="3">
					<h:outputText styleClass="ui-widget" for="username"
						value="${msgs.username}" />
					<p:inputText prependId="false" id="username"  required="true">
						<f:validateLength minimum="4" />
						<f:validateRequired />
						<p:ajax event="blur" update="msgj_username" />
					</p:inputText>
					<h:message styleClass="errorMsg" id="msgj_username" for="username" />

					<h:outputText styleClass="ui-widget" for="password"
						value="${msgs.password}" />
					<p:password prependId="false" id="password" required="true">
						<f:validateLength minimum="4" />
						<f:validateRequired />
						<p:ajax event="blur" update="msgj_password" />
					</p:password>
					<h:message styleClass="errorMsg" id="msgj_password" for="password" />
					<p:commandButton id="login" value="login" action="#{sessionBean.login}"
						ajax="false" />
						
					<h:message styleClass="errorMsg" id="loginError"/>
				</h:panelGrid>
			</h:form>
		</div>
	</ui:define>
</ui:composition>